//
//  CirculateCollectionViewCell.m
//  EDPS
//
//  Created by 张维扬 on 15/11/25.
//  Copyright © 2015年 张维扬. All rights reserved.
//

#import "CirculateCollectionViewCell.h"
#import "Masonry.h"
#import "UIImageView+WebCache.h"
@interface CirculateCollectionViewCell ()
@property (nonatomic, retain) UIImageView *image_url;
@property (nonatomic, retain) UIImageView *last_img;
@end

@implementation CirculateCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.image_url = [[UIImageView alloc] init];
        [self.contentView addSubview:self.image_url];
        
        self.last_img = [[UIImageView alloc] init];
        [self.contentView addSubview:self.last_img];
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [self.image_url mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(self.contentView);
    }];
    [self.last_img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(self.contentView);
    }];
}
- (void)setModel:(ExploreModel *)model
{
    if (_model != model) {
        _model = model;
    }
    [self.image_url sd_setImageWithURL:[NSURL URLWithString:model.image_url] placeholderImage:[UIImage imageNamed:@"hold"]];
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
